const Home = () => import('../views/Home/Home.vue')
const Favor = () => import('../views/Favor/Favor.vue')
const Order = () => import('../views/Order/Order.vue')
const Message = () => import('../views/Message/Message.vue')
const Cityed = () => import('../views/City/City.vue')
const Search = () => import('../views/Search/Search.vue')
const Detail = () => import('../views/Detail/Detail.vue')
import { createRouter, createWebHashHistory } from "vue-router";
const routes = [
  {
    path: '/home', component: Home, meta: {
      keepAlive: true,
    }
  },
  { path: '', redirect: '/home' },
  { path: '/favor', component: Favor },
  { path: '/order', component: Order },
  { path: '/message', component: Message },
  { path: '/search', component: Search },
  {
    path: '/detail', component: Detail, meta: {
      isShow: true
    }
  },
  {
    path: '/city', component: Cityed, name: 'city',
    meta: {
      isShow: true
    }
  },
]

// 3. 创建路由实例并传递 `routes` 配置
// 你可以在这里输入更多的配置，但我们在这里
// 暂时保持简单
const router = createRouter({
  // 4. 内部提供了 history 模式的实现。为了简单起见，我们在这里使用 hash 模式。
  history: createWebHashHistory(),
  routes, // `routes: routes` 的缩写
})
export default router